// Copyright 2023 Specter Ops, Inc.
//
// Licensed under the Apache License, Version 2.0
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0

.node-search-container {
    input {
        font-size: small;
    }
    .icon {
        margin-left: 6px;
        font-size: 1.2rem;
    }
    .secondary .icon {
        font-size: 1.1rem;
    }
    .edge-filter {
        padding: 0 6px;
        .title {
            text-align: center;
        }
        fieldset {
            legend {
                color: $light-blue;
            }
            .icon {
                background: $grey;
                border: 1px solid #000;
                border-radius: 2px;
                font-size: 0.9rem;
                color: #000;
            }
        }
    }
}

.context-menu {
    color: $offblack;
    .title {
        display: block;
        padding: 8px 12px;
        font-weight: bold;
    }
}

table.summary {
    width: 100%;
    border-collapse: collapse;
    th,
    td {
        padding: 6px 10px;
        height: 100%;
    }
    td {
        vertical-align: bottom;
        font-weight: bold;
        text-align: right;
        font-size: x-small;
    }
    th {
        font-size: small;
        vertical-align: top;
        font-weight: normal;
        text-align: left;
    }
    tr {
        height: 100%;
    }
    tbody {
        tr:nth-child(even) {
            background-color: #eee;
        }
    }
}

.entity-info-panel {
    // width: 400px;
    border-radius: 0;

    .entity-info-panel-content {
        .MuiTypography-h6 {
            font-size: small;
        }
        .node {
            margin-left: 10px;
            padding: 4px 7px;
            font-size: small;
        }
    }

    .progress {
        text-align: center;
        padding: 20px 0;
    }
}

.entity-pane {
    display: flex;
    flex-direction: column;
    padding: 10px 10px 6px 12px;

    div {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        margin: 1px 0;
    }

    a {
        text-decoration: underline;
        color: #406f8e;
        font-weight: 500;
    }
}

.info-pane {
    width: 560px;
    font-size: small;

    .info-pane-header {
        padding: 0 20px 0 24px;
        cursor: default;
        display: flex;
        justify-content: space-between;
        align-items: center;

        div.title {
            display: flex;
            align-items: center;
        }

        div.impact {
            width: 7em;
            text-align: center;
            font-weight: bold;
            font-size: 0.9rem;
            border-radius: 5px;
            line-height: 1.6em;
            padding: 2px 0;
        }

        .timeline {
            flex-grow: 1;
            display: flex;
            justify-content: flex-end;
            margin-right: 10px;
        }
    }

    > .info-pane-header {
        &.closed {
        }
    }

    .info-pane-content {
        max-height: calc(100vh - 122px);
        overflow-y: auto;
        > .timeline {
            border-bottom: none;
        }
        hr:last-child {
            display: none;
        }
    }

    .info-pane-risk {
        padding: 0 22px 22px;
        border-top: none;
        h3 {
            margin: 0;
            padding: 10px 0;
        }
        ol {
            padding-inline-start: 24px;
            margin: 0;
        }
        p {
            margin: 20px 0;
        }

        .impact-info {
            padding: 4px 12px 6px 12px;
            font-weight: 500;
        }
    }

    .impact-header {
        display: flex;
        justify-content: space-between;
        margin-bottom: 10px;
    }

    .lazy-table-container {
        height: 200px;
    }

    a.plan {
        display: flex;
        justify-content: space-around;
        margin-top: 10px;
    }

    .actions {
        display: flex;
        justify-content: center;
        margin: 14px 0 0 0;
    }
}

.tooltip {
    position: absolute;
    display: flex;
    align-items: center;
    margin-top: -18px;
    margin-left: 22px;
    width: 74px;
    padding: 6px 8px;
    background-color: #333;
    color: white;
    font-family: sans-serif;
    font-size: 10px;
    text-align: center;
    border-radius: 1.5px 3px 3px 1.5px;
    box-shadow: -2px 2px 6px 0px rgba(94, 94, 94, 1);

    .tooltip-arrow {
        position: absolute;
        left: -11px;
        width: 22px;
        height: 22px;
        transform: rotate(45deg);
        background-color: #333;
        box-shadow: -1px 4px 6px -2px rgba(94, 94, 94, 1);
    }

    .tooltip-content {
        position: relative;
        background-color: #333;
        height: 20px;
        display: flex;
        align-items: center;
    }
}
